package com.zhoug.common3.adapters.recycler.dividers;

import android.graphics.Color;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;

/**
 * @Author 35574
 * @Date 2020/9/8
 * @Description
 */
public class ItemDecorationDrawableBuilder {
    private int color = Color.TRANSPARENT;
    private int width;
    private int height;

    public ShapeDrawable build() {
        ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
        shapeDrawable.getPaint().setColor(color);
        shapeDrawable.setIntrinsicWidth(width);
        shapeDrawable.setIntrinsicHeight(height);
        return shapeDrawable;
    }

    public ItemDecorationDrawableBuilder setColor(int color) {
        this.color = color;
        return this;
    }

    public ItemDecorationDrawableBuilder setWidth(int width) {
        this.width = width;
        return this;
    }

    public ItemDecorationDrawableBuilder setHeight(int height) {
        this.height = height;
        return this;
    }

}
